package com.lujianfei.powerinput.database;

import android.os.Parcel;
import android.os.Parcelable;

import com.orm.SugarRecord;
import com.orm.dsl.Column;
import com.orm.dsl.Table;

@Table(name="TemplateFieldModel")
public class TemplateFieldModel extends SugarRecord implements Parcelable {

    @Column(name="templateId")
    private
    long templateId;

    @Column(name="key")
    private
    String key;

    @Column(name="className")
    private
    String className;

    public TemplateFieldModel() {
    }

    protected TemplateFieldModel(Parcel in) {
        setId(in.readLong());
        templateId = in.readLong();
        key = in.readString();
        className = in.readString();
    }

    public long getTemplateId() {
        return templateId;
    }

    public void setTemplateId(long templateId) {
        this.templateId = templateId;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(getId());
        dest.writeLong(templateId);
        dest.writeString(key);
        dest.writeString(className);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<TemplateFieldModel> CREATOR = new Creator<TemplateFieldModel>() {
        @Override
        public TemplateFieldModel createFromParcel(Parcel in) {
            return new TemplateFieldModel(in);
        }

        @Override
        public TemplateFieldModel[] newArray(int size) {
            return new TemplateFieldModel[size];
        }
    };


}
